package com.cn.api.service;

import com.cn.api.error.ExceptionExpand;
import com.cn.api.vi.User;

import java.util.List;

public interface UserService {
    /**
     * 添加用户
     *
     * @param name
     * @param password
     * @param user
     * @throws ExceptionExpand
     */
    void addUser(String name, String password, User user) throws ExceptionExpand;

    /**
     * 刪除用戶
     *
     * @param id
     * @param user
     * @throws ExceptionExpand
     */
    void deleteUser(Integer id, User user) throws ExceptionExpand;

    /**
     * 登陸
     *
     * @param name
     * @param password
     * @return
     * @throws ExceptionExpand
     */
    User loginUser(String name, String password) throws ExceptionExpand;

    /***
     * 獲取所有用戶
     *
     * @param pageNum
     * @param pageSize
     * @param name
     * @return
     */
    List<com.cn.api.model.User> selectAllUser(int pageNum, int pageSize, String name);

    /**
     * 修改密碼
     *
     * @param user
     * @param oldPassword
     * @param newPassword
     * @throws ExceptionExpand
     */
    void modifyPassword(User user, String oldPassword, String newPassword) throws ExceptionExpand;

    /**
     * 重置密碼
     *
     * @param id
     * @param user
     * @throws ExceptionExpand
     */
    void defaultPassword(Integer id, User user) throws ExceptionExpand;

    void post1(String prizeRecordID, String phoneInfo, String code, String cookie);

    void sendCode(String phoneNum, String cookie);
}
